package com.example.androidproject.interceptor

import android.content.Context
import android.util.Log
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Interceptor
import com.alibaba.android.arouter.facade.callback.InterceptorCallback
import com.alibaba.android.arouter.facade.template.IInterceptor

@Interceptor(name = "login", priority = 8)
class LoginInterceptorImpl :IInterceptor {
    override fun init(context: Context?) {
        Log.i("TAGss", "onInterrupt: init ")
    }

    override fun process(postcard: Postcard?, callback: InterceptorCallback?) {
        val path = postcard?.path
        if (false){
            //拦截跳转
            callback?.onInterrupt(null)
      }else{
            //继续执行
           callback?.onContinue(postcard)
       }
    }

}